import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:moose_app/ui/values/values.dart';

import 'message_read_dot.dart';

class ATHMessageTypeIcon extends StatelessWidget {
  final String svgPath;

  final Color color;

  final Color backgroundColor;

  final bool showReadDot;

  final Function press;

  ATHMessageTypeIcon(
      {this.svgPath,
      this.color = kColor33,
      this.backgroundColor = kColorPrimaryLight,
      this.showReadDot = false,
      this.press});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: press,
      child: Stack(
        children: <Widget>[
          SvgPicture.asset(svgPath, width: kSize90, fit: BoxFit.cover),
          showReadDot
              ? Positioned(
                  right: 0,
                  child: ATHMessageRedDot(),
                )
              : SizedBox()
        ],
      ),
    );
  }
}
